package collection;

import java.util.ArrayList;
import java.util.Collection;

public class CollectionDemo2 {
    public static void main(String[] args) {
        User u1 = new User("jack",22);
        User u2 = new User("tom",21);
        ArrayList<User> list  = new ArrayList<>();
        list.add(u1);
        list.add(u2);
        //判断值需要重写equals方法
        User u3 = new User("tom",21);
        System.out.println(list.contains(u3));


    }
}
